package com.tek.ding.faceding.network;


/**
 * @author byz
 * @data 0219/5/5
 * @Description
 */

public class BuildFactory {

    private static BuildFactory instance;
    private Object apiHttps;

    public static BuildFactory getInstance() {
        if (instance == null) {
            synchronized (BuildFactory.class) {
                if (instance == null) {
                    instance = new BuildFactory();
                }
            }
        }
        return instance;
    }

    public <T> T create(Class<T> a, String type) {
        if (apiHttps == null) {
            synchronized (BuildFactory.class) {
                if (apiHttps == null) {
                    apiHttps = HttpUtils.getInstance().getBuilder(type).build().create(a);
                }
            }
        }
        return (T) apiHttps;
    }

}
